Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT simulator symbian vs N900
Forum Updated to NodeBB v4.3 + New Features

QT simulator symbian vs N900

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 3.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    grumpy
    wrote on last edited by
    #1

    I have the following test case which works as expected on N900. It also works using the QT simulator and Maemo Fremantle, but when using it with QT simulator + any symbian it doesn't. What I am trying to achieve with this code is to get the btTest button to appear in the top left corner of row 0, cell 0. Since I am new to QT I guess this is not how it should be done, and if so how should it be done?
    (I need this for a program where I have to make sure the table uses the biggest font size possible with all columns are visible and table never gets bigger than the screen size)

    Grumpy

    @class MainWindow : public QMainWindow
    {
    QTableWidget *qtw;
    public:
    MainWindow(QWidget *parent = 0){};
    ~MainWindow() {};
    void MakeTable(int width, int height);
    };

    void MainWindow::MakeTable(int width, int height)
    {
    QStringList hlabels, vlabels;
    hlabels << "col_1" << "col_2" << "col_3" << "col_4" << "col_5";
    vlabels << "row_1" << "row_2" << "row_3" << "row_4";
    qtw = new QTableWidget(this);
    qtw->setFont(QFont("Arial", 30));
    qtw->setRowCount(4);
    qtw->setColumnCount(5);
    qtw->setHorizontalHeaderLabels(hlabels);
    qtw->setVerticalHeaderLabels(vlabels);
    qtw->move(0,0);
    qtw->resize(width, 300);
    qtw->show();

    int frameSize = qtw->frameWidth();
    int width_hdr = qtw->verticalHeader()->width();
    int height_hdr = qtw->horizontalHeader()->height();
    
    QPushButton *btTest = new QPushButton("TEST", this);
    btTest->resize(100, 50);
    btTest->move(width_hdr + frameSize, height_hdr + frameSize);
    btTest->show();
    

    }

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.showMaximized();
    w.MakeTable(w.width(), w.height());
    return a.exec();
    }
    @

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      Try this:

      @void MainWindow::MakeTable(int width, int height)
      {
      QStringList hlabels, vlabels;
      hlabels << "col_1" << "col_2" << "col_3" << "col_4" << "col_5";
      vlabels << "row_1" << "row_2" << "row_3" << "row_4";
      qtw = new QTableWidget(this);
      qtw->setFont(QFont("Arial", 30));
      qtw->setRowCount(4);
      qtw->setColumnCount(5);
      qtw->setHorizontalHeaderLabels(hlabels);
      qtw->setVerticalHeaderLabels(vlabels);
      setCentralWidget( qtw );
      qtw->setCellWidget( 0, 0, new QPushButton("TEST", this);
      }@

      1 Reply Last reply
      0
      • G Offline
        G Offline
        grumpy
        wrote on last edited by
        #3

        Thanks,

        This does indeed solve to test case, but my real problem is that:
        verticalHeader()->width();
        seems to return wrong value when used with QT simulator + symbian.

        Grumpy

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kamalakshantv
          wrote on last edited by
          #4

          [quote author="grumpy" date="1285765474"]Thanks,

          This does indeed solve to test case, but my real problem is that:
          verticalHeader()->width();
          seems to return wrong value when used with QT simulator + symbian.

          Grumpy

          [/quote]

          Does it work fine on device. Somethings are known not to work properly on the emulator.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            grumpy
            wrote on last edited by
            #5

            Sadly I don't have a Symbian device to test it on. Maybe I have to get one so I can make sure it works on a real device before I continue with this project.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved