Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:03:54+00:00 2026-06-17T03:03:54+00:00

What I am trying to do I need to split my large style file

  • 0

What I am trying to do I need to split my large style file to small style files
because now it is hard to read the style file(qss file) and add new styling to it.
after that i need to load those small qss files to apply them all

I am loading my Big file by calling function on main I have created

void Utilities::loadEnglishStyle()
{
    QFile file(":/EnglishClasses.qss");
    file.open(QFile::ReadOnly);
    QString StyleSheet = QLatin1String(file.readAll());
    qApp->setStyleSheet(StyleSheet);
    file.close();
}

I thought about split the big file, add the small files to the resources, open all of them by QFile and after that concatenate them all in one string
but every time when adding new qss file i still need to do the same process again

Is there any efficient way to do this ?!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:03:55+00:00Added an answer on June 17, 2026 at 3:03 am

    Your approach sounds correct. The process is not as complex as it sounds. The only thing you need is to add the “smaller” qss file in the resources, under a specific prefix (eg. stylesheets), and then automatically load and concatenate all these files. Sample code follows:

    QDir stylesheetsDir(":/stylesheets");
    QFileInfoList entries = stylesheetsDir.entryInfoList();
    QString completeStylesheet = "";
    foreach (QFileInfo fileInfo, entries)
    {
        QFile file(":/stylesheets/" + fileInfo.fileName(););
        if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
           continue;
    
        QTextStream in(&file);
        completeStylesheet += in.readAll()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to split a large AVI 2.0 (OpenDML format) file in smaller
Hi i was trying to filter a large of text file using Regex.Split with
Using Ruby, I'm trying to parse some documentation in which I need to split
Trying to split this string 主楼怎么走 into separate characters (I need an array) using
I need some help trying to match a C include file with full path
i need some help with creating file Im trying in the last hours to
I am trying to split the following, I need to split it by the
I have a large c# solution file (~100 projects), and I am trying to
I need to deal with super large txt input files, and I usually use
I am writing small IRC Bot, and i need to split incoming messages for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.